﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WAD.WEB.AppCode;
using WAD.Model;
using WAD.DAL;

namespace WAD.WEB.Client2.Ajax
{
    /// <summary>
    /// Advert 的摘要说明
    /// </summary>
    public partial class Feedback : AjaxBase
    {
        public override void AjaxMethodDispatch(String identity)
        {
            switch (identity)
            {
                case "add": this.Add(); break;
            }
        }
        /// <summary>
        /// 添加反馈
        /// </summary>
        [QD.Web.Ajax.AjaxMethod]
        public void Add()
        {
            String contact = Parse.String("contact");//联系方式
            String content = Parse.String("content");//反馈内容

            //验证
            if (String.IsNullOrEmpty(content))
            {
                ParamError();
            }

            MFeedback m = new MFeedback() { contact = contact, content = content };
            bool flag = DaoFeedback.Add(m);
            if (flag)
            {
                Success();
            }
            else
            {
                Fail();
            }
        }
    }
}